import {fetchChargeAmountAnalyze} from '@/services/pay/PayCommon';

export default {
  namespace: 'PIndexChargeAmountAnalyze',

  state: {
    list: [],
  },

  effects: {
    * fetchChargeAmountAnalyze({payload}, {call, put}) {
      const response = yield call(fetchChargeAmountAnalyze, payload);
      if (response.code === 0) {
        yield put({
          type: 'chgList',
          payload: response.data,
        });
      }
    },

  },

  reducers: {
    chgList(state, action) {
      return {
        ...state,
        list: action.payload,
      };
    },
  },
};